From: David Scott Date: Thu, 9 Oct 2014 09:17:29 +0000 (+0100) Subject: xl: move 'replace_string' further up the file X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4171 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=badc6d4474dd6d3582853ca19a65c229f4105da0;p=xen.git xl: move 'replace_string' further up the file This allows the function to be reused more easily. Signed-off-by: David Scott Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index abe9ac63f1..be809c8fb4 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -836,6 +836,12 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info, } } +static void replace_string(char **str, const char *val) +{ + free(*str); + *str = strdup(val); +} + static void parse_config_data(const char *config_source, const char *config_data, int config_len, @@ -1981,13 +1987,6 @@ static int match_option_size(const char *prefix, size_t len, #define MATCH_OPTION(prefix, arg, oparg) \ match_option_size((prefix "="), sizeof((prefix)), (arg), &(oparg)) -static void replace_string(char **str, const char *val) -{ - free(*str); - *str = strdup(val); -} - - /* Preserve a copy of a domain under a new name. Updates *r_domid */ static int preserve_domain(uint32_t *r_domid, libxl_event *event, libxl_domain_config *d_config)